import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.net.Socket;


public class MyThread extends Thread{
	String user  = null;
	Socket client = null;
	PrintStream out;
	BufferedReader in;
	int State = 0;
	
	
	
	public MyThread(Socket client,String user) throws Exception{
		this.client=client;
		this.user = user;
		in = new BufferedReader(new InputStreamReader(client.getInputStream()));
	}
	public void run(){
//		while(true){
			try{
				String str = in.readLine();
				out=new PrintStream(MyServer.mp.get(str).getOutputStream());
				str=in.readLine();
				out.println(user+": "+str);
			}catch(Exception e){
				
			}
//		}
	}
}
